<template>
	<view class="padb20">
		<stop isBack>
			<view slot="content">设备点检详情</view>
		</stop>
		<view class="bcf pad3 lh2" v-if="isbool(order)">
			<view class="list-style-1">基本信息</view>
		<!-- 	<view class="flrc bdbda">
				<view>点检单号:</view>
				<view class="flex1 tar padr3 padtb2 flex-r flex-end">
					{{order.sn}}
				</view>
				<view class="cu-btn sm line-green" @click="copy(order.sn)">复制</view>
			</view> -->
			
			
			<view class="flrc bdbda  fs24 padtb3">
				<view class="flex1 flcc">
					<view class="fwb">{{order.numPoints}}</view>
					<view class="fs8">点检项目</view>
				</view>
				<view class="flex1 flcc">
					<view class="fwb">{{order.numNotCheck}}</view>
					<view class="fs8">未检项目</view>
				</view>
				<view class="flex1 flcc">
					<view class="fwb">{{order.numError}}</view>
					<view class="fs8">异常项目</view>
				</view>
			</view>
			<view class="flrc bdbda">
				<view>点检状态:</view>
				<view class="flex1 tar padtb2 flex-r flex-end">
					<status classes="round2" :item="order.status"></status>
				</view>
			</view>
			<view class="flrc padtb2 bdbda">
				<view>点检类型:</view>
				<view class="flex1 tar" v-if="isbool(order.planSn)">计划点检[{{order.planSn}}]</view>
				<view class="flex1 tar" v-else>随机点检</view>
			</view>
			<view class="flrc bdbda">
				<view>点检职工:</view>
				<view class="flex1 tar padtb2">{{isnull(order.createBy)?'未设置':order.createBy.name}}</view>
			</view>
			<view class="flrc bdbda">
				<view>开始时间:</view>
				<view class="flex1 tar padtb2">{{datetime(order.startAt)}}</view>
			</view>
			<view class="flrc bdbda">
				<view>完成时间:</view>
				<view class="flex1 tar padtb2">{{datetime(order.endAt)}}</view>
			</view>
			
			<view class="list-style-1 martb3">点检部位</view>
			<view v-if="isbool(order.checkItems)">
				<view class="bc13 pad2 mart3" v-for="item in order.checkItems">
					<view class="flrc bcf round3 padlr3 pos-r ofh">
						
						<view class="padr2 fs12">
							<text class="fa fa-angle-right"></text>
						</view>
						<view class="">点检项目</view>
						<view class="flex1 tar padtb3 ofe">
							{{item.point.name}}
						</view>
						<ripple></ripple>
					</view>
					<view class="padb2 bdw3 bcf">
						<view class="block flex1 tal flex-r flex-wrap flex-start">
							<view @tap="item.note = choice " class="pad2"  
							v-for="choice in item.point.choices">
								<view class="padr3 flex1 round padl3 cu-btn" 
								:class="choice == item.value?'bg-blue':'line-blue'">
								{{choice}}
								</view>
							</view>
						</view>
					</view>
					<view class="pad2">
						<view>其他信息</view>
						<view class="bdtda mart2">
							{{item.tips}}
							<view v-if="!isbool(item.tips)" class="bcf tac c12">
								<view class="round3 pad3">无备注</view>
							</view>
						</view>
						<view class="bdtda mart2">
							<view v-for="picItem in item.pics">
								<image @tap="viewPic(pic(picItem),pics(item.pics))" :src="pic(picItem)" mode="widthFix" class="w100"></image>
							</view>
							<view v-if="item.pics.length == 0" class="bcf tac c12">
								<view class="round3 pad3">无附件图片</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<loading :loading="myIsLoading"></loading>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:0,
				order:{}
			}
		},
		methods: {
			
		},
		onLoad(option) {
			let id = option.id
			this.$api.get('/api/machineCheckOrders/' + id,{},res=>{
				this.log(res)
				this.order = res.d
				this.clearLoading()
			})
		}
	}
</script>

<style>

</style>
